
import * as Cesium from 'cesium/Cesium'

function MeasurementMouseHandler(e) {
    this.selectedMeasurement = void 0, this._sseh = new Cesium.ScreenSpaceEventHandler(e.canvas), this._scene = e
}

Cesium.defineProperties(MeasurementMouseHandler.prototype, {
    scene: {
        get: function () {
            return this._scene
        }
    }
}), MeasurementMouseHandler.prototype.activate = function () {
    var e = this._sseh;
    e.setInputAction(this._click.bind(this), Cesium.ScreenSpaceEventType.LEFT_CLICK),
        e.setInputAction(this._clickShift.bind(this), Cesium.ScreenSpaceEventType.LEFT_CLICK, Cesium.KeyboardEventModifier.SHIFT),
        e.setInputAction(this._mouseMove.bind(this), Cesium.ScreenSpaceEventType.MOUSE_MOVE),
        e.setInputAction(this._mouseMoveShift.bind(this), Cesium.ScreenSpaceEventType.MOUSE_MOVE, Cesium.KeyboardEventModifier.SHIFT),
        e.setInputAction(this._handleLeftDown.bind(this), Cesium.ScreenSpaceEventType.LEFT_DOWN),
        e.setInputAction(this._handleLeftUp.bind(this), Cesium.ScreenSpaceEventType.LEFT_UP),
        e.setInputAction(this._handleDoubleClick.bind(this), Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
}, MeasurementMouseHandler.prototype.deactivate = function () {
    var e = this._sseh;
    e.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),
        e.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK, Cesium.KeyboardEventModifier.SHIFT),
        e.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),
        e.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE, Cesium.KeyboardEventModifier.SHIFT),
        e.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),
        e.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),
        e.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
}, MeasurementMouseHandler.prototype._handleDoubleClick = function (e) {
    this.selectedMeasurement.handleDoubleClick(e.position);
    var t = this._scene;
    t.requestRenderMode && t.requestRender()
}, MeasurementMouseHandler.prototype._handleClick = function (e, t) {
    this.selectedMeasurement.handleClick(e.position, t);
    var i = this._scene;
    i.requestRenderMode && i.requestRender()
}, MeasurementMouseHandler.prototype._clickShift = function (e) {
    this._handleClick(e, !0)
}, MeasurementMouseHandler.prototype._click = function (e) {
    this._handleClick(e, !1)
}, MeasurementMouseHandler.prototype._handleMouseMove = function (e, t) {
    this.selectedMeasurement.handleMouseMove(e.endPosition, t);
    var i = this._scene;
    i.requestRenderMode && i.requestRender()
}, MeasurementMouseHandler.prototype._mouseMove = function (e) {
    this._handleMouseMove(e, !1)
}, MeasurementMouseHandler.prototype._mouseMoveShift = function (e) {
    this._handleMouseMove(e, !0)
}, MeasurementMouseHandler.prototype._handleLeftDown = function (e) {
    this.selectedMeasurement.handleLeftDown(e.position);
    var t = this._scene;
    t.requestRenderMode && t.requestRender()
}, MeasurementMouseHandler.prototype._handleLeftUp = function (e) {
    this.selectedMeasurement.handleLeftUp(e.position);
    var t = this._scene;
    t.requestRenderMode && t.requestRender()
}, MeasurementMouseHandler.prototype.isDestroyed = function () {
    return !1
}, MeasurementMouseHandler.prototype.destroy = function () {
    return this.deactivate(), this._sseh.destroy(), Cesium.destroyObject(this)
};
export default MeasurementMouseHandler;